<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-商品信息','%mfile%datepicker')"></head>
<!--<head th:include="common/header_css::header('霸王餐小程序后台管理-订单商品表管理')"></head>-->
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('订单商品表管理')"></div>
        <div th:replace="common/search::search('no')"></div>
    </div>
    <!-- End Panel Basic -->
</div>

<!--添加OrderGoods模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">订单商品表添加</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add"
                                      onsubmit="return checkAdd()">

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单id *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="oid"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单编号 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="orderNo"
                                                           required
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">退款编号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="refundNo"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品id *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="gid"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品规格</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="skuid"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品标价原价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="price"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">实际售价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="saleprice"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">运费 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="yunfei"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">总价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="total"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">购买数量 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="number"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品名 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="goodsName"
                                                           required
                                                           type="text" maxlength="100"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">规格</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="spec"
                                                           type="text" maxlength="100"/>
                                                </div>
                                            </div>
                                        </div>


                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单状态 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="status">
                                                        <option value="-1">已关闭</option>
                                                        <option value="0">已取消</option>
                                                        <option value="1">待支付</option>
                                                        <option value="2">待发货</option>
                                                        <option value="3">待收货</option>
                                                        <option value="4">待评论</option>
                                                        <option value="5">已完成</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">禁用状态 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">优惠多少</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="discount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">物流模板</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="logisticsId"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">运单号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="shipperCode"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">货运公司</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="shipperName"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否主商品 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isDefault"
                                                           value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否评论</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isComment"
                                                           value="-1">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">买单类型 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="type">
                                                        <option value="0">默认</option>
                                                        <option value="0">自己买单</option>
                                                        <option value="2">他人买单</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单购买类型 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="orderType">
                                                        <option value="0">默认</option>
                                                        <option value="1">拼团</option>
                                                        <option value="2">抽奖</option>
                                                        <option value="4">砍价</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品图 *
                                                </label>
                                                <div class="col-sm-10">
                                                    <input id="mfile" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic" name="pic" type="hidden" value=""
                                           required="required"/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--修改OrderGoods模态框-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">订单商品表修改</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单id *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="oid" name="oid"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单编号 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="orderNo" name="orderNo"
                                                           required
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">退款编号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="refundNo" name="refundNo"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品id *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="gid" name="gid" required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品规格</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="skuid" name="skuid"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品标价原价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="price" name="price"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">实际售价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="saleprice" name="saleprice"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">运费 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="yunfei" name="yunfei"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">总价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="total" name="total"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">购买数量 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="number" name="number"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品名 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="goodsName" name="goodsName"
                                                           required
                                                           type="text" maxlength="100"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">规格</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="spec" name="spec"
                                                           type="text" maxlength="100"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单状态 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="status" id="status">
                                                        <option value="-1">已关闭</option>
                                                        <option value="0">已取消</option>
                                                        <option value="1">待支付</option>
                                                        <option value="2">待发货</option>
                                                        <option value="3">待收货</option>
                                                        <option value="4">待评论</option>
                                                        <option value="5">已完成</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">禁用状态 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="state" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">优惠多少</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="discount" name="discount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">物流模板</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="logisticsId" name="logisticsId"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">运单号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="shipperCode" name="shipperCode"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">货运公司</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="shipperName" name="shipperName"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否主商品 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isDefault" name="isDefault" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否评论</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isComment" name="isComment" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">买单类型 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="type" id="type">
                                                        <option value="0">默认</option>
                                                        <option value="0">自己买单</option>
                                                        <option value="2">他人买单</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单购买类型 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="orderType" id="orderType">
                                                        <option value="0">默认</option>
                                                        <option value="1">拼团</option>
                                                        <option value="2">抽奖</option>
                                                        <option value="4">砍价</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品图 *
                                                </label>
                                                <div class="col-sm-10">
                                                    <img id="previewPic" src='' class='file-preview-image' alt=''
                                                         title=''
                                                         style="width: 100px;height: 100px;"/>
                                                    <input id="mfile2" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic2" name="pic" type="hidden" value=""
                                           required="required"/>
                                    <input id="id" name="id" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div th:include="common/footer_js::footer"></div>
<script src="/js/admin/ordergoods.js"></script>
</body>
</html>
